package com.tlx.util;

import java.io.File;

import org.apache.commons.io.FileUtils;

public class TempUtils {

    public static void main(String[] args) throws Exception {
        joinFile();
    }

    public static void joinFile() throws Exception {
        File dir = new File("D:\\piaohan\\yc\\00");
        File[] picList = dir.listFiles();
        StringBuilder sb = new StringBuilder();
        for (File file : picList) {
            sb.append("\n\n----------------------------" + file.getName() + "----------------------------\n");
            sb.append(FileUtils.readFileToString(file, "gbk"));
        }

        FileUtils.writeStringToFile(new File(dir.getParent(), dir.getName() + ".txt"), sb.toString());
    }
}
